Ext.define('Holo.view.ListCircuitPanneaux', {
	extend: 'Ext.NestedList',	
	alias: 'widget.listcircuitpanneaux',

	config : {
		title: 'Circuit',
		iconCls  : 'star',
	    displayField: 'lib',
	    store: 'CircuitsPanneaux',
	},

	/**
	 * Override this method to provide custom template rendering of individual
	 * nodes. The template will receive all data within the Record and will also
	 * receive whether or not it is a leaf node.
	 * @param {Ext.data.Record} node
	 */
	getItemTextTpl: function(node) {
	//	         console.log(this);
	//	         console.log(node);
	    var tpl = '<tpl if="leaf == false">'+
			 	        '<img height="32" width="32" src="data/illustration/{id}.jpg"> : {lib} '+
			 	   '</tpl>'+
		     	   '<tpl if="leaf == true">'+
					     	  '<tpl switch="categorie">'+
				            	 '<tpl case="achat">'+
			     	                '<img src="app/stylesheets/img/pin-blue.png"> <img height="32" width="32" src="data/illustration/{id}.jpg"> :  {lib} '+
			     	              '<tpl case="resto">'+
			     	                ' <img src="app/stylesheets/img/pin-purple.png"> <img height="32" width="32" src="data/illustration/{id}.jpg"> : {lib}'+
			     	            '<tpl default>'+
			     	            	'<img src="app/stylesheets/img/pin-green.png"><img height="32" width="32" src="data/illustration/{id}.jpg"> : {lib} '+
			     	          '</tpl>'+
				    '</tpl>';
	    
	   // var tpl = '{lib} test {id}';
	    return tpl 
	}


});


